<% content_for :title, "Les annonces du SEL" %>

<section class="main_content ad">

  <header>
    <h1>Que proposent les seliens ?</h1>
  </header>

  <% @ads.each do |ad| %>

  <aside>
    <p><%= link_to 'voir', ad, {:title => "voir " + ad.label } %></p>
    <p>
      <%=
        link_to 'éditer',
        {:controller => 'ads', :action => 'edit', :id => ad},
        {:title => "Editer " + ad.label}
      %>
    </p>
    <p>
      <%= link_to 'supprimer', ad, confirm: 'Are you sure?', method: :delete %>
    </p>
  </aside>

  <article>
    <figure>
      <%= image_tag ad.picture.url(:medium) %>
      <figcaption><%= ad.label %></figcaption>
    </figure>

    <header>
      <h1><%= ad.label %></h1>
    </header>

    <p>Par <%= ad.user.username %></p>

    <p>
      Équivalent en peaksel ? <%= ad.cost %> Pk<br />
      Où ? <%= ad.city %><br />
      Quand ? <%=l ad.created_at %><br />
    </p>

    <p class="content"><%= ad.description %></p>
  </article>
  <% end %>
</section>
